<?php
include "file.php";
session_start();

$lignes = file('fichier.txt');


	foreach ($lignes as $num => $data) 
	{
	    if (strpos($data,$_SESSION['username']) === 0) /*researcher the line number */
		{
			echo "Merci de votre visite $lignes[$num]";
	        unset($lignes[$num]);/*Delete pseudo*/
		
	    }
	    
	}

//erase file
file_put_contents('fichier.txt'," ");
/*copy list updated*/
file_put_contents('fichier.txt',$lignes);

?>